

<template>
  <div>
    <z-space vertical>
      <h3>tree_table表格</h3>
      <z-table :columns="columns" height="auto" :selectable="false"
               :sequence="false"
               :data="data" :pagination="false" ></z-table>
    </z-space>
  </div>
</template>

<script>
import DocProps from "@example/plugins/example/components/DocProps";

export default {
  components: {DocProps},
  data() {
    return {
      doc: {
        props: [
          {
            name: 'def',
            type: 'Object',
            defVal: '{columns: [], records: []}',
            desc: '定义'
          }
        ]
      },
      columns: [
        {
          label: '日期',
          prop: 'date'
        },
        {
          label: '姓名',
          prop: 'name',
          formatter(row, column, cellValue) {
            return cellValue + " (男)"
          }
        },
        {
          label: '地址',
          prop: 'address'
        }
      ],
      data:  [{
        id: 1,
        date: '2016-05-02',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        id: 2,
        date: '2016-05-04',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1517 弄'
      }, {
        id: 3,
        date: '2016-05-01',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1519 弄',
        children: [{
          id: 31,
          date: '2016-05-01',
          name: '王小虎1',
          address: '上海市普陀区金沙江路 1519 弄',
          children: [{
            id: 123,
            date: '2016-05-01',
            name: '王小虎11',
            address: '上海市普陀区金沙江路 1519 弄'
          }, {
            id: 122,
            date: '2016-05-01',
            name: '王小虎12',
            address: '上海市普陀区金沙江路 1519 弄'
          }]
        }, {
          id: 32,
          date: '2016-05-01',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1519 弄'
        }]
      }, {
        id: 4,
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }],
      tableData1: [{
        id: 1,
        date: '2016-05-02',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        id: 2,
        date: '2016-05-04',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1517 弄'
      }, {
        id: 3,
        date: '2016-05-01',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1519 弄',
        hasChildren: true
      }, {
        id: 4,
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }]
    }
  },
  mounted() {
  },
  methods: {
  }
}
</script>
